{extend name="public/layout"/}

{block name="assign"}
{assign name="page_title" value="网站配置" /}
{/block}

{block name="body"}
<div class="layui-card">
	<form action="{:url($Request.action)}" method="post" class="layui-form">
		<div class="layui-tab layui-tab-brief" lay-filter="settingTab">

			<ul class="layui-tab-title">
				{volist name="Think.config.web.config_group_list" id="vg"}
				<li class="{eq name='id' value='$key'}layui-this{/eq}">
					<a href="{:url('?id='.$key)}" target="_self">{$vg}配置</a>
				</li>
				{/volist}
			</ul>

			<div class="layui-tab-content">
				<div class="xr-form-container">
					{volist name="data" id="config"}
					<div class="layui-form-item">
						<label class="layui-form-label">{$config.title}</label>
						<div class="layui-input-block">
							{switch name="config->getData('type')"}
							{case value="0"}
							<input type="number" name="config[{$config.name}]" class="layui-input" value="{$config.value}"/>
							{/case}
							{case value="1"}
							<input type="text" name="config[{$config.name}]" class="layui-input" value="{$config.value}"/>
							{/case}
							{case value="2"}
							<textarea name="config[{$config.name}]" class="layui-textarea"
									rows="4">{$config.value}</textarea>
							{/case}
							{case value="3"}
							<textarea name="config[{$config.name}]" class="layui-textarea"
									rows="3">{$config->getData('value')}</textarea>
							{/case}
							{case value="4"}
							<select name="config[{$config.name}]">
								{volist name="config.extra" id="vo"}
								<option value="{$key}" {eq name="config.value" value="$key" }selected{/eq}>{$vo}</option>
								{/volist}
							</select>
							{/case}
							{case value="5" break='0'}{/case}
							{case value="6"}
							<textarea name="config[{$config.name}]" value="{$config.value}"
									class="layui-textarea">{:json_encode($config.value)}</textarea>
							{/case}
							{case value="7"}
							<input type="checkbox" data-toggle="switch" class="layui-input" {$vo.value==0?"":"checked"}/>
							{/case}
							{case value="8"}
							<input type="text" data-mask="999.999.999.9999" name="config[{$config.name}]"
									class="layui-input" value="{$config.value}"/>
							{/case}
							{case value="9"}
							<input type="text" data-mask="9999-9999999" name="config[{$config.name}]" class="layui-input"
									value="{$config.value}"/>
							{/case}
							{case value="10"}
							<input type="text" data-mask="¥ 999,999,999.99" name="config[{$config.name}]"
									class="layui-input" value="{$config.value}"/>
							{/case}
							{/switch}
							<div class="layui-form-mid">{$config.remark}</div>
						</div>
					</div>
					{/volist}

					<div class="layui-form-item">
						<div class="layui-input-block">
							<button type="submit" class="layui-btn layui-btn-danger"
									data-ajax-post="{target:'.layui-form'}">
								<i class="fa fa-save"></i> 保存
							</button>
							<a href="javascript:history.back();" class="layui-btn layui-btn-primary">取消 </a>
						</div>
					</div>
				</div>
			</div>

		</div>
	</form>
</div>
{/block}

{block name="foot"}
<script type="text/javascript">
</script>
{/block}
